<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
%>
<script type="text/javascript" src="<%=path%>/projectjs/ImageFileUpload.js"></script>
<script>
	function setAppMarkVOValue(obj) {
	if (!iu1.validate()) {
		alert("您还有像素为：【"+iu1.need_add_pic_pixel.join(",")+"】的图片要添加，请添加图片！");
		iu1.openAddImgFrame();
		return false;
	}
	return validateCallback(obj, navTabAjaxDone);
}
</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>编辑用户</title>
  </head>
  <body>
	<div class="pageContent">
		<form method="post" action="<%=path %>/appMark/saveAppMark.action" class="pageForm required-validate" onsubmit="return setAdvertisingVOValue(this);">
			<div class="pageFormContent" layoutH="56">
				<br><input name="appMarkVO.id" type="hidden" value="<s:property value="appMarkVO.id" />" />

				<p>
					<label>应用名：</label>
					<input name="appMarkVO.name" value="<s:property value="appMarkVO.name" />" class="required" type="text" size="30" alt="请输入应用名"/>
				</p>
				<p>
					<label>简介：</label>
					<input name="appMarkVO.introduction" value="<s:property value="appMarkVO.introduction" />" class="required" type="text" size="30" alt="请输入简介"/>
				</p>
				<p>
					<label>下载地址：</label>
					<input name="appMarkVO.url" value="<s:property value="appMarkVO.url" />" class="required" type="text" size="30" alt="请输入下载地址"/>
				</p>
				<p style="width: 100%;height: auto;">
					<label>应用图片：</label>
					<a class="button" onclick="openAddImgFrame(1);"><span>添加图片</span></a>
					<a class="btnAttach" id="add_pic_a_id1" href="<%=path%>/jsp/common/image_file_upload.jsp" lookupGroup="attachment" width="560" height="300" style="display: none"></a>
					<div class="divider" style="border:0"></div>
					<div id="pic_need_add_pixel_div1"></div>
					<div class="divider" style="border:0"></div>
					<div id="pic_content_div1" style="float: none;width:auto;padding-left: 150px;width:720px">
					<s:iterator value="appMarkVO.pic.split(',')" id="picName" status="i">
					<div id="pic_div_old_${i.index}" style="border:1 solid #ccc;margin-top:5px;margin-bottom:5px;padding:5px;">
						<b>图片像素：</b>宽<s:property value="#picName.split('_')[1]"/>高<s:property value="#picName.split('_')[2]"/>
						<b style="margin-left:15px">图片：</b><a href="<%=path%>/jsp/common/preview_image.jsp?folder=appMark&picNames=${picName}&id=${appMarkVO.id}" target="dialog" rel="appMarkList" max="true" title="预览图片" width="800" height="480" style="margin-right: 40px">${picName}</a>
						<a href="javascript:;" onclick="removePicContent('pic_div_old_${i.index}','<s:property value="#picName.split('_')[1]"/>_<s:property value="#picName.split('_')[2]"/>','${picName}',1);">移除</a>
					</div>
					</s:iterator>
					</div>	
				</p>
			</div>
			<div class="formBar">
				<ul>
					<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
					<li>
						<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
					</li>
				</ul>
			</div>
		</form>
	</div>
  </body>
 <script type="text/javascript">
	var iu1 = new ImageUpload("${appMarkVO.pic}","appMark","1","${pageContext.request.contextPath}","appMarkVO.pic","114_114");
</script>
</html>